package com.derbysoft.defender.mp.api.response;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>some description here.</p>
 * Created by Afee Lee on 2017-03-19 15:52
 *
 * @author Afee Lee
 * @version 1.0
 * @see Object
 * @since 1.8
 */
public class AccessToken implements Serializable {
    private static final long serialVersionUID = 21265612698155191L;

    private String access_token;

    private Integer expires_in;//in second

    private Date expires;

    public String getAccess_token() {
        return access_token;
    }

    public void setAccess_token(String access_token) {
        this.access_token = access_token;
    }

    public Integer getExpires_in() {
        return expires_in;
    }

    public void setExpires_in(Integer expires_in) {
        this.expires_in = expires_in;
    }

    public Date getExpires() {
        return expires;
    }

    public void setExpires(Date expires) {
        this.expires = expires;
    }

    public AccessToken initExpires() {
        this.expires = new Date(System.currentTimeMillis() + expires_in * 1000);
        return this;
    }
}
